var sqlMap = {
    user:{
        register:'insert into person(id,pwd) values (?,?);',
        login:'select id,pwd from person',
        changePwd:'update person set pwd=? where id=? and pwd=?;',
        addInfo:'insert into customer(c_id,name) values(?,?);',
        updateInfo:'update customer set name=?,sex=? where c_id=?;'
    },
    admin:{
        authority:'update person set isAdimn=? where id=?;',
        deleteCustomer:'delete from customer where id=?;', // 务必与下条命令先后进行
        deletePerson:'delete from person where id=?;'
    },
    cart:{
        add:'insert into cart_detail(c_id,b_id,amount) values (?,?,?);',
        update:'update cart_detail set amount=? where c_id=? and b_id=?;',
        delete:'delete from cart_detail where c_id=? and b_id=?;', // 频繁的更新数据库所造成的压力？
        search:'select * from cart_detail nature join book where c_id=?;'
    },
    orders:{
        add:'insert into orders(c_id,a_id,amount,total) values (?,?,?,?);',
        searchOne:'select * from orders where id=?;',
        searchAll:'select * from orders where c_id=?;',
        delete:'delete from orders where id=?;'
    },
    ordersDetail:{
        add:'insert into order_detail(o_id,b_id,amount,total) values (?,?,?,?);',
        search:'select name,img,total,amount from order_detail nature join book where o_id=?;'
    },
    address:{
        add:'insert into address(c_id,address,mobile,name) values (?,?,?,?);',
        delete:'delete from address where a_id=? and c_id=?;',
        search:'select * from address where c_id=?;',
        update:'update address set address=?,mobile=?,name=? where c_id=? and a_id=?;'
    },
    search:{
        all:'select * from book',
        book:'select * from book where b_id=?;',
        author:'select * from book where author=?;',
        type:'select * from book where type=?;'
    },
    book:{
        add:'insert into book(b_id,name,type,author,publisher,price_origin,discount,stock,info,img) values (?,?,?,?,?,?,?,?,?,?);',
        update:'update address set name=?,type=?,author=?,publisher=?,price_origin=?,discount=?,stock=?,info=?,img=? where b_id=?;',
        delete:'delete from book where b_id=?;'
    },
    author:{
        add:'insert into author(name,sex,info) values (?,?,?);',
        update:'update author set sex=?,info=? where name=?;',
        delete:'delete from author where name=?;'
    },
    type:{
        add: 'insert into type values (?);',
        delete: 'delete from type where name=?;',
        update: 'update type set name=? where name=?;'
    },
    publisher:{
        add: 'insert into publisher values (?);',
        delete: 'delete from type where name=?;'
    }
}
module.exports = sqlMap